Skip to content

Add habit management to CLI and TUI - #231

Merged
robzolkos merged 3 commits into
mainfrom
feature/habit-management
Aug 21, 2026
Merged

Add habit management to CLI and TUI#231
robzolkos merged 3 commits into
mainfrom
feature/habit-management

Conversation

@robzolkos

@robzolkos robzolkos commented Aug 21, 2026

Copy link
Copy Markdown
Collaborator

Adds habit creation, editing, and deletion to the CLI and Calendar TUI so habits can be managed without returning to the web app. Existing complete/uncomplete behavior remains unchanged.

What changed

  • Adds hey habit create, hey habit edit (update alias), and hey habit delete through the typed HEY SDK.
  • Accepts weekday names or 06, validates HEY's supported icon/color values locally, and supports partial edits.
  • Adds Calendar TUI forms for creating and editing habits, visible-habit selection, and confirmed deletion.
  • Restricts TUI creation to the personal calendar and refreshes recordings after successful mutations.
  • Preserves form and selection state after API failures so mutations can be retried.
  • Updates command discovery, README/skill documentation, API coverage, and smoke coverage.

Scope

  • TUI edit/delete applies to habits visible in the current calendar range because HEY does not expose a typed habit list/get API.
  • Habit stop/resume and list/get are outside this card.
  • No haystack or hey-sdk changes are required; hey-sdk v0.7.0 already provides the CRUD operations.

Validation

  • GOWORK=off make test — passed
  • GOWORK=off make lint — passed, 0 issues
  • GOWORK=off make build — passed
  • GOWORK=off make test-smoke — passed against app.hey.localhost:3003, including TestHabitCreateEditDelete
  • Independent code review — no blocking or actionable findings

Delivery and risk

No migration, configuration, feature flag, or deploy ordering is required. Main review focus: Calendar TUI input/state routing and the shared icon/color/weekday validation.

Basecamp card: https://app.basecamp.com/2914079/buckets/48521764/card_tables/cards/10206892903


Summary by cubic

Add habit creation, editing, and deletion to the CLI and Calendar TUI so users can manage habits without the web app. Previously only completion/uncompletion was available; now full CRUD is supported, with TUI creation limited to the personal calendar and deletion requiring confirmation bound to the selected habit.

  • CLI: adds hey habit create, hey habit edit (update alias), and hey habit delete; accepts weekday names or 0–6, validates icon/color locally (flag help lists accepted values), supports stdin for names, sends partial edits, and returns JSON summaries.
  • Calendar TUI: adds create/edit forms (Tab/Shift+Tab to move, Enter advances, Ctrl+S to save); press a to create on the personal calendar, select visible habits with [/], edit with e, and delete with x twice. Delete confirmation is tied to the selected habit and resets on other keys, selection change, or recordings reload. After mutations, recordings refresh and notices show results; on API failure, forms keep values, selection stays put, and account switching is blocked only while saving/deleting.
  • Models now include icon, color, and days; calls use Habits().Create/Update/Delete from hey-sdk.

Scope

  • Manage actions target habits visible in the current calendar range; stop/resume and list/get remain out of scope.
  • No migration, configuration, feature flags, or deploy ordering. Review focus: Calendar TUI input/state routing, deletion confirmation binding, mutation flow, and locking during saves.

Written for commit 709a396. Summary will update on new commits.

Review in cubic

Copilot AI balanced review requested due to automatic review settings August 21, 2026 03:09
@robzolkos
robzolkos requested a review from a team as a code owner August 21, 2026 03:09

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds SDK-backed habit creation, editing, and deletion to the CLI and Calendar TUI, with shared validation and expanded documentation/tests.

Tip

If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.

Changes:

  • Adds CLI habit CRUD commands with validation and structured output.
  • Adds TUI habit forms, selection, deletion confirmation, and refresh behavior.
  • Updates models, documentation, command discovery, and test coverage.

Reviewed changes

Copilot reviewed 18 out of 18 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
.surface Records the expanded CLI surface.
API-COVERAGE.md Documents habit CRUD endpoint coverage.
README.md Documents CLI and TUI habit management.
skills/hey/SKILL.md Adds habit management examples.
internal/cmd/habit.go Implements habit CRUD commands.
internal/cmd/habit_test.go Tests CRUD requests and validation.
internal/cmd/help_test.go Updates habit help expectations.
internal/habit/days.go Parses and formats weekdays.
internal/habit/days_test.go Tests weekday parsing.
internal/habit/values.go Defines valid icons and colors.
internal/habit/values_test.go Tests icon and color validation.
internal/models/calendar.go Adds habit fields to recordings.
internal/tui/calendar.go Integrates habit management into Calendar.
internal/tui/calendar_test.go Updates Calendar help tests.
internal/tui/habit_form.go Implements create/edit forms.
internal/tui/habit_form_test.go Tests form and mutation behavior.
internal/tui/translate_test.go Tests habit field translation.
tests/smoke/habit_test.go Adds end-to-end habit CRUD coverage.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread internal/tui/calendar.go
@robzolkos
robzolkos force-pushed the feature/habit-management branch 2 times, most recently from 9c1cea3 to 8a967d4 Compare August 21, 2026 06:11
@robzolkos
robzolkos force-pushed the feature/habit-management branch from 8a967d4 to 709a396 Compare August 21, 2026 06:16
@robzolkos
robzolkos merged commit 3349f69 into main Aug 21, 2026
23 checks passed
@robzolkos
robzolkos deleted the feature/habit-management branch August 21, 2026 06:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants